<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEmailSetsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('email_sets', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('company_id')->comment('公司id');
            $table->string('host',255)->comment('服务器地址');
            $table->string('port',255)->comment('服务器端口');
            $table->string('user_name',255)->comment('用户名');
            $table->string('password',255)->comment('密码');
            $table->string('address',255)->comment('发送地址');
            $table->string('name',255)->comment('发送人姓名');
            $table->string('offer_title',255)->default('')->comment('offer模板名');
            $table->text('offer_content',2000)->comment('offer模板');
            $table->tinyInteger('type')->default(2)->comment('是否加密 1：不加密 2：ssl 3:tls');
            $table->tinyInteger('is_use')->default(1)->comment('是否开启 1：开启 2：关闭');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('email_sets');
    }
}
